package com.itheima.hello.hellopromax高级进阶.接口;

import java.util.ArrayList;
//学生管理类
public class classManager {
    private ArrayList<com.itheima.hello.hellopromax高级进阶.接口.student> student = new ArrayList<>();
    private studentOp studentOp = new studentImpl2();     //多态,可以使用studentImpl1/2
//    private studentOp studentOp = new studentImpl1();
    public classManager() {
        com.itheima.hello.hellopromax高级进阶.接口.student s2 = new student();
        s2.setName("赵丽颖");
        s2.setSex('女');
        s2.setScore(99);
        student.add(s2);
        com.itheima.hello.hellopromax高级进阶.接口.student s1 = new student("杨幂", '女', 98);
        student.add(s1);
        student.add(new student("迪丽热巴", '女', 99));
        student.add(new student("玛玛哈哈", '女', 96));
        student.add(new student("亚瑟", '男', 60));
        student.add(new student("马超", '男', 88));
        student.add(new student("韩信", '男', 100));
    }

    //打印全班全部人的信息
    public void printinfo(){
        studentOp.printAllinfo(student);
    }
    //打印全班全部人的平均分
    public void printavgsco(){
        studentOp.printavgscore(student);
    }
}
